import { SettingOutlined } from "@ant-design/icons";
import { Button, Input } from "antd";
import TextArea from "antd/lib/input/TextArea";
import { useEffect, useState } from "react";
import { useDispatch, useSelector } from "umi";

export default function Index(props: any) {
    // const Dispatch = useDispatch()
    //     "systemUrl": "creationad.shbwyz.com",
    //   "systemTitle": "小楼又清风",
    //   "systemLogo": "https://bwcreation.adminSystemUrl-cn-beijing.aliyuncs.com/2021-12-03/wipi-logo.png",
    //   "systemFavicon": "https://wipi.oss-cn-shanghai.aliyuncs.com/2021-02-20/wipi-favicon.png",
    //   "systemFooterInfo": "回家后哈哈哈哈哈哈哈哈哈哈",
    const [adminSystemUrl, setadminSystemUrl] = useState('');
    const [systemUrl, setsystemUrl] = useState('');
    const [systemTitle, setsystemTitle] = useState('');
    const [systemLogo, setsystemLogo] = useState('');
    const [systemFavicon, setsystemFavicon] = useState('');
    const [systemFooterInfo, setsystemFooterInfo] = useState('');
    setTimeout(() => {
        setsystemUrl(props.InitialValue.systemUrl)
        setsystemTitle(props.InitialValue.systemTitle)
        setadminSystemUrl(props.InitialValue.adminSystemUrl)
        setsystemLogo(props.InitialValue.systemLogo)
        setsystemFavicon(props.InitialValue.systemFavicon)
        setsystemFooterInfo(props.InitialValue.systemFooterInfo);
    })
    useEffect(() => {
    console.log(1);
    
    }, [])
    
    return (
        <div>
            <p>
                系统地址 <Input value={systemUrl} />
            </p>
            <p>
                后台地址 <Input value={systemTitle} />
            </p>
            <p>
                系统标题 <Input value={adminSystemUrl} />
            </p>
            <p>
                Logo  <Input addonAfter={<SettingOutlined />} value={systemLogo} />
            </p>
            <p>
                Favicon  <Input addonAfter={<SettingOutlined />} value={systemFavicon} />
            </p>
            <p>
                页脚信息 <TextArea rows={4} value={systemFooterInfo} />
            </p>
            <Button type="primary">保存</Button>
        </div>
    )
}
